package com.pls.entity;

import java.util.ArrayList;
import java.util.List;

import com.pls.data.EmployeeData;
import com.pls.data.ProjectData;

public class Employee {
	//Instance Fields
	private String firstName;
	private String middleName;
	private String lastName;
	private String emailAddress;
	private int id;
	private String positionCode;
	private List<Project> projectList;
	

	//Getters and Setters
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getMiddleName() {
		return middleName;
	}
	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String getEmailAddress() {
		return emailAddress;
	}
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getPositionCode() {
		return positionCode;
	}
	public void setPositionCode(String positionCode) {
		this.positionCode = positionCode;
	}
	public List<Project> getProjectList() {
		return projectList;
	}
	public void setProjectList(List<Project> projectList) {
		this.projectList = projectList;
	}
	
	public Employee getEmployeeById(int id)
	{
		EmployeeData data = new EmployeeData();
		return data.getEmployeeById(id);
	}
	
	public Employee getEmployeeWithProjects(int id){
		EmployeeData data = new EmployeeData();
		Employee employee = data.getEmployeeById(id);
		
		ProjectData projData = new ProjectData();
		List<Project> projectList = projData.getProjectsByEmployeeId(id);
		
		employee.setProjectList(projectList);
		
		return employee;
	}
}
